Moved explode call lower down and added strip slash code