fixed bug, added test

@wesdotcool