added trimming of command to alert function to leave out the "; alert" bit