fix for issue #1144

@splinter89 thanks :)