Bash prompt wraparound

I'm using a custom prompt with PS1 in my .profile. It is

PS1="\[\e[0;35m\]\u@\e[0;31m\h\[\e[m\]\[\e[0;36m\]:\W\[\e[m\] \[\e[0;32m\]\$\[\e[m\] \[\e[0;37m\]"

and it works well, as you can see,
http://content.screencast.com/users/killer54291/folders/Jing/media/2b3db52a-ebf7-43e2-95cc-f45dadbc2b98/00000023.png

but, when i type more than the width of the window, it wraps around the window and overwrites any text.

And different ones don't do that. Anyone tell what the problem is?

---------- Post updated at 10:27 PM ---------- Previous update was at 09:06 PM ----------

I figured it out. I was missing one part where you declare the color. I also removed the \[\e[m\]'s because those werent actually doing anything? the correct code is.:

PS1='\[\e[0;32m\]\u\[\e[0;37m\]@\[\e[0;35m\]\h:\[\e[0;36m\]\W \[\e[1;31m\]\$\[\e[0;37m\]'

it needed \[ before every color and stuff at the end. you could lock the topic if you want. its solved.