Fixed bug in previous version