fixed bug with null pointer in velocity