What error are you getting? I do things like that routinely, and haven't had a problem, so there isn't anything fundamentally wrong with your approach.